//
//  DTCBaseTableViewCell.m
//  TJHYHardwareProduct
//
//  Created by yc on 2017/12/25.
//  Copyright © 2017年 Cong Yao. All rights reserved.
//

#import "DTCBaseTableViewCell.h"

@implementation DTCBaseTableViewCell
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self)
    {
        [self masLayoutSubview];
    }
    return self;
}

- (void)awakeFromNib {
    [super awakeFromNib];
    self.selectionStyle = UITableViewCellSelectionStyleNone;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
}

- (UILabel *)line {
    if (!_line) {
        _line = [[UILabel alloc]init];
        _line.backgroundColor = [UIColor colorWithHexString:@"#DCDCDC"];
        _line.hidden = YES;
        [self.contentView addSubview:_line];
        [self.contentView bringSubviewToFront:_line];
    }
    return _line;
}

- (void)setCorWithType:(UIRectCorner)cornerType roundRect:(CGRect)rect size:(CGSize)size superLayer:(CALayer *)superLayer {
    UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:rect byRoundingCorners:cornerType cornerRadii:size];
    CAShapeLayer *layer = [CAShapeLayer new];
    [layer setFillColor:[UIColor whiteColor].CGColor];
    layer.frame = rect;
    [layer setPath:maskPath.CGPath];
    [superLayer addSublayer:layer];
}

- (void)masLayoutSubview
{
    
}

@end
